import { defineStore } from 'pinia'
import { pressureGet } from '../api/pressureData'
interface dataListType {
    address: string,
    addressId: string,
    nowPressure: number,
    uploadTime: string,
    ResponseTimes: number,
    actualTimes: number,
    qualifiedTimes: number,
    qualifiedProbability: number,
    averageValue: number,
    miniPressure: number,
    miniTime: string,
    maxPressure: number,
    maxTime: string,
    averageValueB: number,
    miniB: number,
    miniTimeB: string,
    maxB: number,
    maxTimeB: string,
    averageValueCa: number,
    miniCa: number,
    miniTimeCa: string,
    maxCa: number,
    maxTimeCa: string,
    averageValueCb: number,
    miniCb: number,
    miniTimeCb: string,
    maxCb: number,
    maxTimeCb: string,
    averageValueCc: number,
    miniCc: number,
    miniTimeCc: string,
    maxCc: number,
    maxTimeCc: string
}

interface stateStyle {
    dataList: Array<dataListType>
}
export const userPressureData = defineStore('alerts', {
    state: () => <stateStyle>({
        dataList: [],
    }),
    // 条件查询
    actions: {
        async dataInit(page: number, limit: number, timeValue: Array<string>) {
            let res = await pressureGet(page, limit, ['asd'])
            this.dataList = res.data.results
            console.log(res);
            console.log(this.dataList);
        }
    }
})
